<?php
require_once '../sub/init.php';
if (!ifint($uid))alert_adm("UID不正确","back");
header("Cache-control: private");
require_once 'chkUadm.php';
if(!in_array('u_jb_list',$QXARR))exit(noauth());
require_once ZEAI.'cache/udata.php';
$FT=json_decode(FT,true);
$row_sl=shalou_data($uid,'all');
$row_shalou=json_decode($row_sl['jsonstr'],true);
$sl_photo_f=$row_sl['photo_f'];
if (!$row_shalou)alert_adm("沙漏数据丢失","back");
$rows = $db->ROW(__TBL_USER__,"*","id=".$uid,"name");
if ($rows){
	$id = $rows['id'];$uid = $id;
	$sex       = $rows['sex'];
	$grade     = $rows['grade'];
	$crm_ugrade= $rows['crm_ugrade'];
	$myinfobfb = $rows['myinfobfb'];
	$photo_s   = $rows['photo_s'];
	$RZZ       = $rows['RZ'];
	$sex_new     = $row_shalou['sex'];
	$photo_s_new = $row_shalou['photo_s'];
	$myinfobfb_new = get_shalou_ed_bfb($row_shalou);
	$photo_s_url = (!empty($photo_s))?UP.smb($photo_s,'s'):RES.'photo_s'.$sex.'.png';
	$photo_s_str = '<img src="'.$photo_s_url.'">';
	$photo_s_url_new = (!empty($photo_s_new))?UP.smb($photo_s_new,'s'):RES.'photo_s'.$sex_new.'.png';
	$photo_s_str_new = '<img src="'.$photo_s_url_new.'">';
	$click = $rows['click'];
	$regtime = $rows['regtime'];
	$endtime = $rows['endtime'];
	$regip = $rows['regip'];
	$endip = $rows['endip'];
	$openid = $rows['openid'];
	$regkind = $rows['regkind'];
	$admid = $rows['admid'];
	$tguid = $rows['tguid'];
	$subscribe = $rows['subscribe'];
	$admname = $rows['admname'];
	$grade     = $rows['grade'];
	$if2       = $rows['if2'];
	$sjtime    = $rows['sjtime'];
	$sjtime2   = $rows['sjtime2'];
	$Ukind   = $rows['kind'];
	$flag    = $rows['flag'];
	$dataflag = $rows['dataflag'];
	$agenttitle = trimhtml(dataIO($rows['agenttitle'],'out'));
	$admname = trimhtml(dataIO($rows['admname'],'out'));
}else{alert_adm("UID不正确","back");}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="<?php echo HOST;?>/res/www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="css/main.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css">
</head>
<style>
a.noU58{width:60px;height:75px;position:relative;line-height:75px;border-radius:0}
a.noU58 img{margin-top:-3px;vertical-align:middle;width:60px;max-height:75px}
a.noU58 span{display:block;width:100%;line-height:24px;position:absolute;top:29px;background-color:rgba(0,0,0,0.4);color:#ccc;font-size:12px}
.datali li{display:inline-block;padding:1px 5px;border:#ddd 1px solid;margin:3px;border-radius:3px;color:#888}
.mate li{color:#5EB87B;border-color:#A7CAB2}
.photombox{width:60px;margin:10px auto;position:relative}
.photombox .del{background-image:url('images/picadd.png?3');background-size:120px 80px;background-repeat:no-repeat;width:20px;height:20px;top:-10px;right:-10px;position:absolute;border-radius:10px;background-position:-80px top;display:block;box-shadow:0 0 5px rgba(0,0,0,0.3)}
.photombox .del:hover{background-position:-100px top;cursor:pointer}
.forcerz{margin-left:20px;display:inline-block;vertical-align:middle}
i.wxlv{color:#31C93C;margin-right:2px}

.shalou{width:750px;border:0;border-collapse:collapse;background-color:#fff;margin:15px auto 30px 30px;border:#eee 1px solid}
.shalou tr:hover td{background-color:#F5F6FA}
.shalou td{border-bottom:solid #F5F6FA 1px;background-color:#fff;padding:5px 10px;color:#999}
.shalou td.jt {text-align:center}
.shalou td.jt i{color:#bbb;font-size:18px;}
.shalou td b{color:#444;margin-left:8px;font-weight:normal;float:right}
.shalou td a.cut{width:62px;display:block;margin:0 auto 10px auto;text-align:center}
/*.shalou tr.ismod td,*/.shalou tr.ismod td b{color:#f00;font-weight:normal}
.shalou tr.ismod td:first-child b{color:#50A7FF;font-weight:normal}
.shalou tr td.zoyqt{font-size:14px;background-color:#fff;position:relative;text-align:center}
.shalou tr td.zoyqt button{position:absolute;right:0px;top:0}
.shaloubox{/*height:300px;overflow:hidden;*/margin-bottom:30px}
.shalou tr.nomod{display:none}

#onoffbtn{position:fixed;left:800px;top:15px}
.reginfo{width:250px;position:fixed;left:800px;top:75px;background-color:#fff;padding:15px}
.reginfo li{line-height:30px;border-bottom:#f2f2f2 1px solid;text-align:left;font-weight:normal;font-size:12px}
</style>
<body>
<div class="shaloubox">
<table class="shalou" id="shalou<?php echo $id;;?>">
    <tr>
    <td width="350" height="30" align="center" class="S16 B">原资料<span style="font-weight:normal;margin-left:10px" class="<?php if($myinfobfb >80){echo ' myinfobfb2';}elseif($myinfobfb >20){echo ' myinfobfb1';}else{echo ' myinfobfb0';}?>"><?php echo $myinfobfb;?>%</span></td>
    <td width="50">&nbsp;</td>
    <td width="350" align="center" class="S16 B">新资料<span style="font-weight:normal;margin-left:10px" class="<?php if($myinfobfb_new >80){echo ' myinfobfb2';}elseif($myinfobfb_new >20){echo ' myinfobfb1';}else{echo ' myinfobfb0';}?>"><?php echo $myinfobfb_new;?>%</span></td>
    </tr>
    <tr>
    <td height="30" colspan="3" align="center" class="S16"><span>UID：</span><?php echo $uid;if(!empty($RZZ)){?><div title="手动强制认证" uid="<?php echo $id;?>" class="forcerz "><?php echo RZ_html($RZZ,'s','color');?></div><?php }?><div class="S12">加红资料表示用户修改过，新老数据有变化</div></td>
    </tr>
    <tr>
    <td colspan="3" align="center" class="zoyqt">个人资料
    
    <button type="button" id="onoffbtn" class="btn size3 LAN2 off" onClick="data_show_Fn(this,<?php echo $uid;?>)"><i class="ico">&#xe60b;</i> 显示全部资料</button>
    <div class="reginfo">
        <?php if (!empty($agenttitle)){?><li>所属门店：</font><?php echo $agenttitle;?></li><?php }?>
        <?php if (ifint($admid)){?><li>认领红娘：</font><?php echo $admname;echo ' ID:'.$admid;?></li><?php }?>
    	<li>帐号类型：<?php echo user_kind($Ukind); ?></li>
    	<li>帐号状态：<?php echo flagtitle($flag);?></li>
    	<li>线上等级：<?php echo uicon($sex.$grade).utitle($grade).vip_time($grade,$sjtime,$sjtime2); ?></li>
        <li>线下等级：<?php echo crm_ugrade_title($crm_ugrade);?></li>
        <li>个人资料：<?php
			switch ($dataflag) {
				case 0:echo '<font class="Cf00">审核中</font>';break;
				case 1:echo '正常';break;
				case 2:echo '<font class="C00f">已驳回</font>';break;
			}
            ?>
    	</li>
        <?php if ($sl_photo_f == 0){?><li>头　　像：<font class="Cf00">审核中</font></li><?php }?>
		<?php 
        $openid_str=(!empty($openid))?'<i class="ico wxlv">&#xe607;</i>':'';
        switch ($regkind) {
            case 1:$regkind_str  = 'PC注册';break;
            case 2:$regkind_str  = 'PC微信扫码';break;
            case 3:$regkind_str  = '<i class="ico wxlv">&#xe607;</i>微信关注/登录';break;
            case 4:$regkind_str  = 'QQ登录';break;
            case 5:$regkind_str  = '新浪微博';break;
            case 6:$regkind_str  = $openid_str.'手机端注册';break;
            case 7:$regkind_str  = '<i class="ico wxlv">&#xe607;</i>微信小程序';break;
            case 8:$regkind_str  = '手机APP';break;
            case 9:$regkind_str  = (ifint($admid))?'<font class="C666">'.$admname.'(ID:'.$admid.')</font>':'';break;
            case 10:if(ifint($admid))$regkind_str = '<font class="C666">'.$admname.'(ID:'.$admid.')</font>';break;
            case 11:
                $regkind_str  = (ifint($admid))?'<font class="C666">'.$admname.'(ID:'.$admid.')</font>':'';
                $regkind_str  = '表单采集-'.$regkind_str; 
            break;
            case 12:$regkind_str  = 'Excel导入';break;
            default:$regkind_str = '未知';break;
        }
        $regkind_str=($Ukind==4)?'机器人':$regkind_str;
		echo '<br><li>注册来源：'.$regkind_str.'</li>';
        if (ifint($tguid)){
            $tgrow = $db->ROW(__TBL_TG_USER__,"nickname,title,kind","id=".$tguid,"name");
            if ($tgrow){
                $nickname_tg = dataIO($tgrow['nickname'],'out');
                $title_tg    = $tgrow['title'];
                $kind_tg     = $tgrow['kind'];
                if($kind_tg==2 || $kind_tg == 3)$nickname_tg=$title_tg;
                echo '<li>推荐人：'.$nickname_tg.'<br>推荐人ID：'.$tguid.' ';
                if($tgflag==0)echo '<font class="Cf60">未验证</font>';
				echo '</li>';
            }
        }
        if($subscribe==1){
            echo '<li>公众号：<i class="ico S14 wxlv" title="已关注">&#xe6b1;</i></li>';
        }elseif($subscribe==2){
            echo '<li>公众号：<span class="C00f">取消</span></li>';
        }
        ?>
    	
    	<li>注册时间：<?php echo YmdHis($regtime); ?></li>
        <li>最近时间：<?php echo YmdHis($endtime); ?></li>
    	<li>注册IP：<?php echo $regip; ?></li>
    	<?php if (!empty($endip)){ ?><li>最近IP：<?php echo $endip; ?></li><?php }?>
        
        <li>人气：<?php echo $click; ?></li>
        <?php if (!empty($longitude)){ ?>
    	<li>经度：<?php echo $longitude; ?></li>
    	<li>纬度：<?php echo $latitude; ?><a href="http://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=<?php echo $longitude; ?>&pointy=<?php echo $latitude; ?>&name=当前位置&addr=当前位置&ref=myapp" target="_blank"><img src="images/gps.gif" style="display:inline"></a></li>
		<?php }?>
        
    </div>
    
    
    
    </td>
    </tr>
    <!---->
    <?php 
    $mateshowflag=0;
    foreach ($row_shalou as $F=>$V) {
        //if($rows[$F] == $V)continue;
        $ismodclas=($rows[$F] != $V)?' class="ismod"':' class="nomod"';
        $T = $FT[$F]['t'];
        $S = $FT[$F]['s'];
        if(empty($V) || $F=='mate_areaid' || $F=='mate_areaid2' ||  $F=='areaid'||  $F=='area2id' ||  $F=='mate_age1' ||  $F=='mate_heigh1' ||  $F=='mate_weigh1')continue;
        if(strstr($F,'mate_')){
            $F2 = str_replace("mate_","",$F);
        }else{
            $F2 = $F;
        }
        switch ($S) {//1:文本,2:单选,3:复选,4:区间,5:特殊
            default://1,4,5
                switch ($F) {
                    case 'heigh':
                        $DATAlod_str = udata('heigh',$rows[$F]);
                        $DATAnew_str = udata('heigh',$V);
                    break;
                    case 'weigh':
                        $DATAlod_str = udata('weigh',$rows[$F]);
                        $DATAnew_str = udata('weigh',$V);
                    break;
                    case 'tag':
                        $DATAlod_str = udata('tag'.$rows['sex'],$rows[$F]);
                        $DATAnew_str = udata('tag'.$row_shalou['sex'],$V);
                    break;
                    case 'mate_age2':
                        $DATAlod_str = $rows['mate_age1'].'～'.$rows['mate_age2'].'岁';
                        $DATAnew_str = $row_shalou['mate_age1'].'～'.$row_shalou['mate_age2'].'岁';;
                    break;
                    case 'mate_heigh2':
                        $DATAlod_str = $rows['mate_heigh1'].'～'.udata('heigh',$rows['mate_heigh2']);
                        $DATAnew_str = $row_shalou['mate_heigh1'].'～'.udata('heigh',$row_shalou['mate_heigh2']);
                    break;
                    case 'mate_weigh2':
                        $DATAlod_str = $rows['mate_weigh1'].'～'.udata('weigh',$rows['mate_weigh2']);
                        $DATAnew_str = $row_shalou['mate_weigh1'].'～'.udata('weigh',$row_shalou['mate_weigh2']);
                    break;
                    case 'nickname':
                        $DATAlod_str = uicon($sex.$grade).trimhtml(dataIO($rows[$F],'out'),'keep_rn');
                        $DATAnew_str = uicon($sex_new.$grade).trimhtml(dataIO($V,'wx'),'keep_rn');
                    break;
                    default:
                        $DATAlod_str = trimhtml(dataIO($rows[$F],'out'),'keep_rn');
                        $DATAnew_str = trimhtml(dataIO($V,'wx'),'keep_rn');
                    break;
                }
            break;
            case 2:
                $DATAlod_str = udata($F2,$rows[$F]);
                $DATAnew_str = udata($F2,$V);
            break;
            case 3:
                $DATAlod_str = udata($F2,$rows[$F]);
                $DATAnew_str = udata($F2,$V);
            break;
        }
        if(strstr($F,'mate_') && $mateshowflag==0){
            $mateshowflag=1;
            ?>
            <tr><td colspan="3" align="center" class="zoyqt">择偶要求</td></tr>
            <?php
        }
        ?>
  <tr<?php echo $ismodclas;?>>
        <td align="left">
            <?php
            if($F=='photo_s'){?>
                <div class="photombox">
                    <a href="javascript:;" class="noU58 sex<?php echo $sex; ?>" onClick="parent.piczoom('<?php echo smb($photo_s_url,'b'); ?>');"><?php echo $photo_s_str; ?></a>
                </div>
                <?php
			}elseif($F=='weixin_pic' && !empty($DATAlod_str)){	?>
				<a href="javascript:;" class="noU58" onClick="parent.piczoom('<?php echo UP.$DATAlod_str; ?>');"><img src="<?php echo UP.$DATAlod_str;?>"></a>
            	<?php
            }else{
                echo $T.'<b>'.$DATAlod_str.'</b>';
            }
            ?>
        </td>
        <td class="jt"><i class="ico">&#xe62d;</i></td>
        <td align="left">
            <?php
            if($F=='photo_s'){?>
                <div class="photombox">
                    <a href="javascript:;" class="noU58 sex<?php echo $sex; ?>" onClick="parent.piczoom('<?php echo smb($photo_s_url_new,'b'); ?>');"><?php echo $photo_s_str_new; ?></a>
                </div>
                <?php
			}elseif($F=='weixin_pic' && !empty($DATAnew_str)){echo $T; ?>
				<a href="javascript:;" class="noU58 FR" onClick="top.piczoom('<?php echo UP.$DATAnew_str; ?>');"><img src="<?php echo UP.$DATAnew_str;?>"></a>
            	<?php
            }else{
                echo $T.'<b>'.$DATAnew_str.'</b>';
            }
            ?>
        </td>
        </tr>
        <?php
    }
    ?>
</table>
</div>
<!---->
<script>
function data_show_Fn(that,id){
	if(that.hasClass('on')){
		that.html('<i class="ico">&#xe60b;</i> 显示全部资料');
		that.removeClass('on');
		that.addClass('off');
		zeai.listEach('.nomod2',function(obj){
			obj.removeClass('nomod2');
			obj.addClass('nomod');
		});	
	}else{
		
		that.html('<i class="ico">&#xe60a;</i> 收起全部资料');
		that.removeClass('off');
		that.addClass('on');
		
		zeai.listEach('.nomod',function(obj){
			obj.removeClass('nomod');
			obj.addClass('nomod2');
		});	
	}
}
</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<br><br><br>
<?php
function udata_title($data_data,$f,$kind='') {foreach($data_data as $v){if($v['fieldname'] == $f)if($kind=='subkind'){return $v['subkind'];}else{return $v['title'];}}}
require_once 'bottomadm.php';?>